package com.yuntai.pms.model.enums;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @Description:redis执行
 * @Author:xuty@hsyuntai.com
 * @Date:2019/91/28
 * @Copyright: 版权归 hsyuntai 所有
 */
public enum RedisExcuteType {
    SELECT("select", "查询"),
    DELETE("delete", "删除"),
    CHECK("check", "检测存在"),
    FUZZZY_SELECT("fuzzySelect", "模糊查询"),
    BATCH_DEL("batchDel", "批量删除"),
    ADD("add","新增"),

    LIST("list", "LIST"),
    SET("set", "SET"),
    HSAH("hash", "HASH"),
    STRING("string","STRING"),

    CONTENT("content", "内容"),
    LEN("len", "长度");

    private String code;
    private String desc;

    private final  static Map<String,Object> excuteMap = new LinkedHashMap<String,Object>();
    private final  static Map<String,Object> valueTypeMap = new LinkedHashMap<String,Object>();
    private final  static Map<String,Object> resultTypeMap = new LinkedHashMap<String,Object>();

    static   {
        excuteMap.put(RedisExcuteType.SELECT.getCode(), RedisExcuteType.SELECT.getDesc());
        excuteMap.put(RedisExcuteType.CHECK.getCode(), RedisExcuteType.CHECK.getDesc());
        excuteMap.put(RedisExcuteType.FUZZZY_SELECT.getCode(), RedisExcuteType.FUZZZY_SELECT.getDesc());
        excuteMap.put(RedisExcuteType.DELETE.getCode(), RedisExcuteType.DELETE.getDesc());
        excuteMap.put(RedisExcuteType.BATCH_DEL.getCode(), RedisExcuteType.BATCH_DEL.getDesc());
        excuteMap.put(RedisExcuteType.ADD.getCode(), RedisExcuteType.ADD.getDesc());

        valueTypeMap.put(RedisExcuteType.LIST.getCode(), RedisExcuteType.LIST.getDesc());
        valueTypeMap.put(RedisExcuteType.SET.getCode(), RedisExcuteType.SET.getDesc());
        valueTypeMap.put(RedisExcuteType.HSAH.getCode(), RedisExcuteType.HSAH.getDesc());
        valueTypeMap.put(RedisExcuteType.STRING.getCode(), RedisExcuteType.STRING.getDesc());

        resultTypeMap.put(RedisExcuteType.CONTENT.getCode(), RedisExcuteType.CONTENT.getDesc());
        resultTypeMap.put(RedisExcuteType.LEN.getCode(), RedisExcuteType.LEN.getDesc());
    }

    private RedisExcuteType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static Map<String,Object> getExcuteMap() {
        return excuteMap;
    }

    public static Map<String,Object> getValueTypeMap() {
        return valueTypeMap;
    }

    public static Map<String,Object> getResultTypeMap() {
        return resultTypeMap;
    }}
